
function Get-CMSoftwareUpdatesPackage
{
<#
.Synopsis
    Returns a Software Updates Package, or all instances of an Software Updates Package.
.Description
    Returns an Software Updates Package, or all instances of an Software Updates Package.
.Parameter SiteServerName 
    ConfigMgr Site Server Name
.Parameter PackageID
    Enter PackageID    
.Parameter Credential 
    Enter Alternate Credentials if required
.Example
    Get-CMSoftwareUpdatesPackage
.Example
    Get-CMSoftwareUpdatesPackage MYTESTLABServer
        Returns all instances of the SMS_SoftwareUpdatesPackage Class on MYTESTLABServer
.Example
    Get-CMSoftwareUpdatesPackage MYTESTLABServer LAB00012 
        Returns Software Updates Package LAB20012 on MYTESTLABServer
.Example
    Get-CMSoftwareUpdatesPackage MYTESTLABServer LAB00012 get-credential
        Prompts for credentials
.Example
    Get-CMSoftwareUpdatesPackage MYTESTLABServer LAB00012 $Cred
        uses credentials in $Cred
.Outputs
    Returns either an instance, or multiple instances from the SMS_SoftwareUpdatesPackage Class
.Link
    http://msdn.microsoft.com/en-us/library/cc145597.aspx
.Notes
 NAME:      Get-CMSoftwareUpdatesPackage
 AUTHOR:    Greg Ramsey
 LASTEDIT:  07/05/2009 10:54:05
#Requires -Version 2.0
#>

[CmdletBinding(
    SupportsShouldProcess=$False,
    SupportsTransactions=$False, 
    ConfirmImpact="None",
    DefaultParameterSetName="")]
param(
[Parameter(Position=0)]
[String]$ComputerName="." ,

[Parameter(Position=1)]
[String]$PackageID ,

[Parameter(Position=2)]
[String]$Filter ,

[Parameter(Position=3)]
$Credential
)

Begin
{
}#Begin

Process
{
    get-cmobject -class SMS_SoftwareUpdatesPackage -ComputerName $ComputerName -Filter $Filter -Credential $Credential | ? {$_.PackageID -like ($PackageID + "*")}
}#Process

End
{
}#End
}

